import { defHttp } from "@/utils/http";

// ERP 医院组 VO
export interface HosGrpVO {
	id: number; // 医院组ID
	hspId: number; // 医院ID
	name: string; // 医院组名称
	grpId: number; // 分组
	sqNumb: number; // 序号
}

// ERP 医院组 API
export const HosGrpApi = {
	// 查询医院组分页
	getHosGrpPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/hsp-grp/page`, params });
	},

	// 查询医院组详情
	getHosGrp: async (id: number) => {
		return await defHttp.get({ url: `/whs/hsp-grp/get?id=` + id });
	},

	// 新增医院组
	createHosGrp: async (data: HosGrpVO) => {
		return await defHttp.post({ url: `/whs/hsp-grp/create`, data });
	},

	// 修改医院组
	updateHosGrp: async (data: HosGrpVO) => {
		return await defHttp.put({ url: `/whs/hsp-grp/update`, data });
	},

	// 删除医院组
	deleteHosGrp: async (id: number) => {
		return await defHttp.delete({ url: `/whs/hsp-grp/delete?id=` + id });
	},

	// 导出医院组 Excel
	exportHosGrp: async (params: any) => {
		return await defHttp.download({ url: `/whs/hsp-grp/export-excel`, params });
	}
};
